home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / TESTSPAR / IDE.H < prev    next >
Encoding:
Text File  |  2001-02-09  |  3.0 KB  |  104 lines

  1. ;+
  2. ; Edit History
  3. ;
  4. ; Sep-05-90    ml.    Definitions of constants for the IDE disk interface
  5. ;            (wrt PrairieTek 120 drive.)
  6. ;-
  7.  
  8.  
  9.  
  10. ; Command codes for IDE disk interface
  11.  
  12. RECAL        equ    $10        ; Recalibrate
  13. READ        equ    $20        ; Read Sector(s)
  14. WRITE        equ    $30        ; Write Sector(s)
  15. VERIFY        equ    $40        ; Read Verify Sector(s)
  16. FMTTRK        equ    $50        ; Format Track
  17. SEEK        equ    $70        ; Seek
  18. DIAG        equ    $90        ; Execute Drive Diagnostic
  19. INITPARM    equ    $91        ; Initialize Drive Parameters
  20. RSBUF        equ    $e4        ; Read Sector Buffer
  21. WSBUF        equ    $e8        ; Write Sector Buffer
  22. IDENTIFY    equ    $ec        ; Identify Drive
  23.                     ; Standby Commands
  24. STANDBY        equ    $e0        ; go to STANDBY mode
  25. ACTIVE        equ    $e1        ; go to ACTIVE mode
  26. SBWTO        equ    $e2        ; StandBy mode With Time-Out
  27. AWTO        equ    $e3        ; Active mode With Time-Out
  28. SSC        equ    $e5        ; Set Sector Count wrt current mode
  29. SBRES        equ    $e6        ; StandBy until RESet
  30.  
  31.  
  32.  
  33. ; Command Modifiers
  34.  
  35. NO_RETRIES    equ    $01        ; no retries
  36. LCMD        equ    $02        ; long command
  37.  
  38.  
  39.  
  40. ; Time-outs
  41. D_WORST        equ    2000        ; worst case delay (10s)
  42.  
  43.  
  44.  
  45. ; IDE disk interface I/O locations for Read functions
  46.  
  47. bIDE    equ    $FFF00000+REGBASE    ; base address
  48.  
  49. IDEDR    equ    bIDE-REGBASE+($00*REGLSTEP); Data Register (16-bit reg)
  50. IDEER    equ    bIDE+($01*REGLSTEP)    ; Error Register
  51. IDESC    equ    bIDE+($02*REGLSTEP)    ; Sector Count
  52. IDESN    equ    bIDE+($03*REGLSTEP)    ; Sector Number
  53. IDECL    equ    bIDE+($04*REGLSTEP)    ; Cylinder Low
  54. IDECH    equ    bIDE+($05*REGLSTEP)    ; Cylinder High (2 bits)
  55. IDESDH    equ    bIDE+($06*REGLSTEP)    ; SDH register
  56. IDESR    equ    bIDE+($07*REGLSTEP)    ; Status Register
  57. IDEASR    equ    bIDE+($0E*REGLSTEP)    ; Alternate Status Register
  58. IDEDAR    equ    bIDE+($0F*REGLSTEP)    ; Drive Address Register
  59.  
  60.  
  61.  
  62. ; IDE disk interface I/O locations for Write functions
  63.  
  64. ;IDEDR    equ    bIDE-REGBASE+($00*REGLSTEP); Data Register (16-bit reg)
  65. IDEWPR    equ    bIDE+($01*REGLSTEP)    ; Write Precomp Register (not used)
  66. ;IDESC    equ    bIDE+($02*REGLSTEP)    ; Sector Count
  67. ;IDESN    equ    bIDE+($03*REGLSTEP)    ; Sector Number
  68. ;IDECL    equ    bIDE+($04*REGLSTEP)    ; Cylinder Low
  69. ;IDECH    equ    bIDE+($05*REGLSTEP)    ; Cylinder High (2 bits)
  70. ;IDESDH    equ    bIDE+($06*REGLSTEP)    ; SDH register
  71. IDECR    equ    bIDE+($07*REGLSTEP)    ; Command Register
  72. IDEDOR    equ    bIDE+($0E*REGLSTEP)    ; Digital Output Register
  73.  
  74.  
  75.  
  76. ; Byte offset from beginning of buffer return by the Identify command
  77.  
  78. NCYL    equ    2        ; offset to # of fixed cylinders
  79. NHEAD    equ    6        ; offset to # of heads
  80. NSPT    equ    12        ; offset to # of physical sectors/track
  81. MDLNUM    equ    54        ; offset to model number of drive
  82. EMDL    equ    94        ; offset to end of model number
  83. CONMDL    equ    MDLNUM+26    ; offset to Conner's model number
  84. CPNCYL    equ    260        ; offset to # of cylinders (Conner)
  85. CPNHEAD    equ    262        ; offset to # of heads (Conner)
  86. CPNSPT    equ    263        ; offset to # of sectors/track (Conner)
  87.  
  88. ; Default drive parameters of Conner Peripherals - CP2024
  89. CP20NCYL    equ    615    ; # of cylinders
  90. CP20NHEAD    equ    4    ; # of heads
  91. CP20NSPT    equ    17    ; # of sectors/track
  92.  
  93.  
  94. ; Address of the Programmable Sound Generator Port A
  95.  
  96. PSGA    equ    $ffff8802
  97. IDERST    equ    6
  98.  
  99. .if    !DRIVER
  100.  
  101. IDERDY        equ        1000    ; delay to wait for IDE drive to be ready
  102.  
  103. .endif    ;DRIVER
  104.